using System;
using System.Collections.Generic;
using System.Text;

namespace Ruction
{
    internal class MessageHandler : MarshalByRefObject
	{
        internal void Broadcast(object data)
		{
			this.OnMessageRecieved( data.ToString() );
		}

        internal delegate void Message(string data);
        internal event Message MessageRecieved;

        internal void OnMessageRecieved(string data)
		{
			if ( this.MessageRecieved != null )
			{
				this.MessageRecieved( data + Environment.NewLine );
			}
		}
	}
}
